Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

natsFrom(N) → cons(N, n__natsFrom(n__s(N)))
fst(pair(XS, YS)) → XS
snd(pair(XS, YS)) → YS
splitAt(0, XS) → pair(nil, XS)
splitAt(s(N), cons(X, XS)) → u(splitAt(N, activate(XS)), N, X, activate(XS))
u(pair(YS, ZS), N, X, XS) → pair(cons(activate(X), YS), ZS)
head(cons(N, XS)) → N
tail(cons(N, XS)) → activate(XS)
sel(N, XS) → head(afterNth(N, XS))
take(N, XS) → fst(splitAt(N, XS))
afterNth(N, XS) → snd(splitAt(N, XS))
natsFrom(X) → n__natsFrom(X)
s(X) → n__s(X)
activate(n__natsFrom(X)) → natsFrom(activate(X))
activate(n__s(X)) → s(activate(X))
activate(X) → X

Q is empty.


QTRS
  ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

natsFrom(N) → cons(N, n__natsFrom(n__s(N)))
fst(pair(XS, YS)) → XS
snd(pair(XS, YS)) → YS
splitAt(0, XS) → pair(nil, XS)
splitAt(s(N), cons(X, XS)) → u(splitAt(N, activate(XS)), N, X, activate(XS))
u(pair(YS, ZS), N, X, XS) → pair(cons(activate(X), YS), ZS)
head(cons(N, XS)) → N
tail(cons(N, XS)) → activate(XS)
sel(N, XS) → head(afterNth(N, XS))
take(N, XS) → fst(splitAt(N, XS))
afterNth(N, XS) → snd(splitAt(N, XS))
natsFrom(X) → n__natsFrom(X)
s(X) → n__s(X)
activate(n__natsFrom(X)) → natsFrom(activate(X))
activate(n__s(X)) → s(activate(X))
activate(X) → X

Q is empty.

Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

AFTERNTH(N, XS) → SPLITAT(N, XS)
ACTIVATE(n__natsFrom(X)) → NATSFROM(activate(X))
SEL(N, XS) → AFTERNTH(N, XS)
ACTIVATE(n__s(X)) → S(activate(X))
SPLITAT(s(N), cons(X, XS)) → ACTIVATE(XS)
ACTIVATE(n__s(X)) → ACTIVATE(X)
TAKE(N, XS) → SPLITAT(N, XS)
SPLITAT(s(N), cons(X, XS)) → U(splitAt(N, activate(XS)), N, X, activate(XS))
ACTIVATE(n__natsFrom(X)) → ACTIVATE(X)
AFTERNTH(N, XS) → SND(splitAt(N, XS))
SPLITAT(s(N), cons(X, XS)) → SPLITAT(N, activate(XS))
U(pair(YS, ZS), N, X, XS) → ACTIVATE(X)
TAIL(cons(N, XS)) → ACTIVATE(XS)
SEL(N, XS) → HEAD(afterNth(N, XS))
TAKE(N, XS) → FST(splitAt(N, XS))

The TRS R consists of the following rules:

natsFrom(N) → cons(N, n__natsFrom(n__s(N)))
fst(pair(XS, YS)) → XS
snd(pair(XS, YS)) → YS
splitAt(0, XS) → pair(nil, XS)
splitAt(s(N), cons(X, XS)) → u(splitAt(N, activate(XS)), N, X, activate(XS))
u(pair(YS, ZS), N, X, XS) → pair(cons(activate(X), YS), ZS)
head(cons(N, XS)) → N
tail(cons(N, XS)) → activate(XS)
sel(N, XS) → head(afterNth(N, XS))
take(N, XS) → fst(splitAt(N, XS))
afterNth(N, XS) → snd(splitAt(N, XS))
natsFrom(X) → n__natsFrom(X)
s(X) → n__s(X)
activate(n__natsFrom(X)) → natsFrom(activate(X))
activate(n__s(X)) → s(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ DependencyPairsProof
QDP
      ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

AFTERNTH(N, XS) → SPLITAT(N, XS)
ACTIVATE(n__natsFrom(X)) → NATSFROM(activate(X))
SEL(N, XS) → AFTERNTH(N, XS)
ACTIVATE(n__s(X)) → S(activate(X))
SPLITAT(s(N), cons(X, XS)) → ACTIVATE(XS)
ACTIVATE(n__s(X)) → ACTIVATE(X)
TAKE(N, XS) → SPLITAT(N, XS)
SPLITAT(s(N), cons(X, XS)) → U(splitAt(N, activate(XS)), N, X, activate(XS))
ACTIVATE(n__natsFrom(X)) → ACTIVATE(X)
AFTERNTH(N, XS) → SND(splitAt(N, XS))
SPLITAT(s(N), cons(X, XS)) → SPLITAT(N, activate(XS))
U(pair(YS, ZS), N, X, XS) → ACTIVATE(X)
TAIL(cons(N, XS)) → ACTIVATE(XS)
SEL(N, XS) → HEAD(afterNth(N, XS))
TAKE(N, XS) → FST(splitAt(N, XS))

The TRS R consists of the following rules:

natsFrom(N) → cons(N, n__natsFrom(n__s(N)))
fst(pair(XS, YS)) → XS
snd(pair(XS, YS)) → YS
splitAt(0, XS) → pair(nil, XS)
splitAt(s(N), cons(X, XS)) → u(splitAt(N, activate(XS)), N, X, activate(XS))
u(pair(YS, ZS), N, X, XS) → pair(cons(activate(X), YS), ZS)
head(cons(N, XS)) → N
tail(cons(N, XS)) → activate(XS)
sel(N, XS) → head(afterNth(N, XS))
take(N, XS) → fst(splitAt(N, XS))
afterNth(N, XS) → snd(splitAt(N, XS))
natsFrom(X) → n__natsFrom(X)
s(X) → n__s(X)
activate(n__natsFrom(X)) → natsFrom(activate(X))
activate(n__s(X)) → s(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 2 SCCs with 12 less nodes.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
QDP
            ↳ UsableRulesProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__natsFrom(X)) → ACTIVATE(X)
ACTIVATE(n__s(X)) → ACTIVATE(X)

The TRS R consists of the following rules:

natsFrom(N) → cons(N, n__natsFrom(n__s(N)))
fst(pair(XS, YS)) → XS
snd(pair(XS, YS)) → YS
splitAt(0, XS) → pair(nil, XS)
splitAt(s(N), cons(X, XS)) → u(splitAt(N, activate(XS)), N, X, activate(XS))
u(pair(YS, ZS), N, X, XS) → pair(cons(activate(X), YS), ZS)
head(cons(N, XS)) → N
tail(cons(N, XS)) → activate(XS)
sel(N, XS) → head(afterNth(N, XS))
take(N, XS) → fst(splitAt(N, XS))
afterNth(N, XS) → snd(splitAt(N, XS))
natsFrom(X) → n__natsFrom(X)
s(X) → n__s(X)
activate(n__natsFrom(X)) → natsFrom(activate(X))
activate(n__s(X)) → s(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__natsFrom(X)) → ACTIVATE(X)
ACTIVATE(n__s(X)) → ACTIVATE(X)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
QDP
            ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

SPLITAT(s(N), cons(X, XS)) → SPLITAT(N, activate(XS))

The TRS R consists of the following rules:

natsFrom(N) → cons(N, n__natsFrom(n__s(N)))
fst(pair(XS, YS)) → XS
snd(pair(XS, YS)) → YS
splitAt(0, XS) → pair(nil, XS)
splitAt(s(N), cons(X, XS)) → u(splitAt(N, activate(XS)), N, X, activate(XS))
u(pair(YS, ZS), N, X, XS) → pair(cons(activate(X), YS), ZS)
head(cons(N, XS)) → N
tail(cons(N, XS)) → activate(XS)
sel(N, XS) → head(afterNth(N, XS))
take(N, XS) → fst(splitAt(N, XS))
afterNth(N, XS) → snd(splitAt(N, XS))
natsFrom(X) → n__natsFrom(X)
s(X) → n__s(X)
activate(n__natsFrom(X)) → natsFrom(activate(X))
activate(n__s(X)) → s(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: